package com.guonl.controller;

import com.guonl.dao.ClusterMessageMapper;
import com.guonl.entity.ClusterMessage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by guonl
 * Date 2020/6/7 7:00 PM
 * Description:
 */
@Api(tags = "集群管理")
@RestController
@RequestMapping("/cluster")
public class ClusterMessageController {

    @Autowired
    private ClusterMessageMapper messageMapper;

    @ApiOperation(value = "新增")
    @PostMapping("/insertClusterMessage")
    public ResponseEntity insertClusterMessage(ClusterMessage message){
        Integer integer = messageMapper.insertClusterMessage(message);
        return ResponseEntity.ok(integer);
    }

    @ApiOperation(value = "查询")
    @PostMapping("/getClusterMessage")
    public ResponseEntity insertClusterMessage(){
        List<ClusterMessage> clusterMessage = messageMapper.getClusterMessage();
        return ResponseEntity.ok(clusterMessage);
    }


}
